<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: D:/Projects/MiXiM/extsrc/mixim/src/inet_stub/networklayer/common/InterfaceTable.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00390.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">InterfaceTable.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span>
<a name="l00002"></a>00002 <span class="comment">// Copyright (C) 2005 Andras Varga</span>
<a name="l00003"></a>00003 <span class="comment">//</span>
<a name="l00004"></a>00004 <span class="comment">// This program is free software; you can redistribute it and/or</span>
<a name="l00005"></a>00005 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00006"></a>00006 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00007"></a>00007 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00008"></a>00008 <span class="comment">//</span>
<a name="l00009"></a>00009 <span class="comment">// This program is distributed in the hope that it will be useful,</span>
<a name="l00010"></a>00010 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00011"></a>00011 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00012"></a>00012 <span class="comment">// GNU Lesser General Public License for more details.</span>
<a name="l00013"></a>00013 <span class="comment">//</span>
<a name="l00014"></a>00014 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>
<a name="l00015"></a>00015 <span class="comment">// License along with this program; if not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00016"></a>00016 <span class="comment">//</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef __INET_INTERFACETABLE_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define __INET_INTERFACETABLE_H</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;INETDefs.h&quot;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;IInterfaceTable.h&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;InterfaceEntry.h&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;NotificationBoard.h&quot;</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 
<a name="l00067"></a><a class="code" href="a00106.html">00067</a> <span class="keyword">class </span>INET_API <a class="code" href="a00106.html">InterfaceTable</a> : <span class="keyword">public</span> cSimpleModule, <span class="keyword">public</span> <a class="code" href="a00100.html">IInterfaceTable</a>, <span class="keyword">protected</span> <a class="code" href="a00102.html">INotifiable</a>
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069   <span class="keyword">protected</span>:
<a name="l00070"></a>00070     <a class="code" href="a00164.html">NotificationBoard</a> *nb; <span class="comment">// cached pointer</span>
<a name="l00071"></a>00071 
<a name="l00072"></a>00072     <span class="comment">// primary storage for interfaces: vector indexed by id; may contain NULLs;</span>
<a name="l00073"></a>00073     <span class="comment">// slots are never reused to ensure id uniqueness</span>
<a name="l00074"></a>00074     <span class="keyword">typedef</span> std::vector&lt;InterfaceEntry *&gt; InterfaceVector;
<a name="l00075"></a>00075     InterfaceVector idToInterface;
<a name="l00076"></a>00076 
<a name="l00077"></a>00077     <span class="comment">// fields to support getNumInterfaces() and getInterface(pos)</span>
<a name="l00078"></a>00078     <span class="keywordtype">int</span> tmpNumInterfaces; <span class="comment">// caches number of non-NULL elements of idToInterface; -1 if invalid</span>
<a name="l00079"></a>00079     <a class="code" href="a00104.html">InterfaceEntry</a> **tmpInterfaceList; <span class="comment">// caches non-NULL elements of idToInterface; NULL if invalid</span>
<a name="l00080"></a>00080 
<a name="l00081"></a>00081   <span class="keyword">protected</span>:
<a name="l00082"></a>00082     <span class="comment">// displays summary above the icon</span>
<a name="l00083"></a>00083     <span class="keyword">virtual</span> <span class="keywordtype">void</span> updateDisplayString();
<a name="l00084"></a>00084 
<a name="l00085"></a>00085     <span class="comment">// displays the interface IPv4/IPv6 address on the outgoing link that corresponds to the interface</span>
<a name="l00086"></a>00086     <span class="keyword">virtual</span> <span class="keywordtype">void</span> updateLinkDisplayString(<a class="code" href="a00104.html">InterfaceEntry</a> *entry);
<a name="l00087"></a>00087 
<a name="l00088"></a>00088     <span class="comment">// discover and store which nwlayer/host gates connect to this interface</span>
<a name="l00089"></a>00089     <span class="keyword">virtual</span> <span class="keywordtype">void</span> discoverConnectingGates(<a class="code" href="a00104.html">InterfaceEntry</a> *entry);
<a name="l00090"></a>00090 
<a name="l00091"></a>00091     <span class="comment">// called from InterfaceEntry</span>
<a name="l00092"></a>00092     <span class="keyword">virtual</span> <span class="keywordtype">void</span> interfaceChanged(<a class="code" href="a00104.html">InterfaceEntry</a> *entry, <span class="keywordtype">int</span> category);
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     <span class="comment">// internal</span>
<a name="l00095"></a>00095     <span class="keyword">virtual</span> <span class="keywordtype">void</span> invalidateTmpInterfaceList();
<a name="l00096"></a>00096 
<a name="l00097"></a>00097   <span class="keyword">public</span>:
<a name="l00098"></a>00098     <a class="code" href="a00106.html">InterfaceTable</a>();
<a name="l00099"></a>00099     <span class="keyword">virtual</span> ~<a class="code" href="a00106.html">InterfaceTable</a>();
<a name="l00100"></a><a class="code" href="a00106.html#abde330e4adcc5a7495f89b8cd6154275">00100</a>     <span class="keyword">virtual</span> std::string <a class="code" href="a00106.html#abde330e4adcc5a7495f89b8cd6154275">getFullPath</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> cSimpleModule::getFullPath();}
<a name="l00101"></a>00101 
<a name="l00102"></a>00102   <span class="keyword">protected</span>:
<a name="l00103"></a>00103     <span class="keyword">virtual</span> <span class="keywordtype">int</span> numInitStages()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 2;}
<a name="l00104"></a>00104     <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize(<span class="keywordtype">int</span> stage);
<a name="l00105"></a>00105 
<a name="l00109"></a>00109     <span class="keyword">virtual</span> <span class="keywordtype">void</span> handleMessage(cMessage *);
<a name="l00110"></a>00110 
<a name="l00111"></a>00111   <span class="keyword">public</span>:
<a name="l00116"></a>00116     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00102.html#a26809ed59b2ff3e9379b1b4440227a8d">receiveChangeNotification</a>(<span class="keywordtype">int</span> category, <span class="keyword">const</span> cObject *details);
<a name="l00117"></a>00117 
<a name="l00121"></a>00121     <span class="keyword">virtual</span> cModule *<a class="code" href="a00100.html#a2f0c6da3baff7416b8914d8a393bff7f">getHostModule</a>();
<a name="l00122"></a>00122 
<a name="l00129"></a>00129     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00100.html#a7b54fe5e63bb7d4c76483b7fa27e506f">addInterface</a>(<a class="code" href="a00104.html">InterfaceEntry</a> *entry);
<a name="l00130"></a>00130 
<a name="l00136"></a>00136     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00100.html#a229a92e5d530127efb262e8fe7acfdf9">deleteInterface</a>(<a class="code" href="a00104.html">InterfaceEntry</a> *entry);
<a name="l00137"></a>00137 
<a name="l00141"></a>00141     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a00100.html#a2b0ce46cd92da6f64fc363410dc71904">getNumInterfaces</a>();
<a name="l00142"></a>00142 
<a name="l00152"></a>00152     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#a19ce4ca3b47b52b8e2b67c25806c4b49">getInterface</a>(<span class="keywordtype">int</span> pos);
<a name="l00153"></a>00153 
<a name="l00159"></a>00159     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#a92764d620c345b7261de20e9ee5247d7">getInterfaceById</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>);
<a name="l00160"></a>00160 
<a name="l00165"></a>00165     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#a31ab0c95a4bf741f1f8aa03e1cf76986">getInterfaceByNodeOutputGateId</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>);
<a name="l00166"></a>00166 
<a name="l00171"></a>00171     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#a60257f3b30cedc18a80835d5be8305d9">getInterfaceByNodeInputGateId</a>(<span class="keywordtype">int</span> <span class="keywordtype">id</span>);
<a name="l00172"></a>00172 
<a name="l00177"></a>00177     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#a8d10b748bc5429c706fab120c719e335">getInterfaceByNetworkLayerGateIndex</a>(<span class="keywordtype">int</span> index);
<a name="l00178"></a>00178 
<a name="l00183"></a>00183     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#a54ae8859390945b1d565e6732f27f848">getInterfaceByInterfaceModule</a>(cModule *ifmod);
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 
<a name="l00189"></a>00189     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#a8ad86ee823d6200b4f558383b39af658">getInterfaceByName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name);
<a name="l00190"></a>00190 
<a name="l00197"></a>00197     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#ad9b040947200941201b8c82d35c7abee">getFirstLoopbackInterface</a>();
<a name="l00198"></a>00198 
<a name="l00203"></a>00203     <span class="keyword">virtual</span> <a class="code" href="a00104.html">InterfaceEntry</a> *<a class="code" href="a00100.html#a5d953f7e65da1885c6c85d0dfa890874">getFirstMulticastInterface</a>();
<a name="l00204"></a>00204 };
<a name="l00205"></a>00205 
<a name="l00206"></a>00206 <span class="preprocessor">#endif</span>
<a name="l00207"></a>00207 <span class="preprocessor"></span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>InterfaceTable.h</b>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:30 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
